#pragma once
#include "PDTType.h"
#include "PDTVar.h"
#include "PDTSetVar.h"

class PDTSequenceVar  :  public PDTSetVar, public TraverseIfc <PDTSequenceVar , PDTNode> { 
    public:  TRAVERSAL_IFC_IMPL(PDTSequenceVar)
public:
    PDTSequenceVar (PDTCodeGraph & CG, PDTSequence & aSequence, string name) ;

    PDTSequence * getSequence() const {return (PDTSequence*)getSet();}
    void setSequence(PDTSequence & aSequence) {setSet((PDTSet&)aSequence);}

    NodeTypeEnum getType() {return PDTSequenceVar_Em;}
    virtual bool isSequenceVar() {return true;}
    virtual bool isVar() {return true;}
    virtual PDTNode* getNode() {return this;}

    virtual ~PDTSequenceVar(){}
	virtual PDTNode* getValue();

	virtual PDTNode* clone(PDTCodeGraph &CG)
	{
		PDTNode* toReturn;
		stringstream sss;
		sss<<cloneID;
		//TODO: getSequence()->clone();
		toReturn = new PDTSequenceVar(CG, *getSequence() ,getName()+"!"+sss.str());
		return toReturn;
	}

    virtual stringstream & toString(stringstream & ss) const {
        ss << getName();
        return ss;
    }
};
